package mn.idax.exchange.otc.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Create by jack_huang on 2018/8/29
 */
@Getter
@AllArgsConstructor
public enum CommentTypeEnum {


    COMMENT_GOOD(1,"COMMENT_GOOD"),
    COMMENT_MEDIUM(0,"COMMENT_MEDIUM"),
    COMMENT_NEGATIVE(-1,"COMMENT_NEGATIVE"),

    ;
    private Integer code;
    private String msg;

    public static Integer getCode(Integer code) {
        for (CommentTypeEnum commentTypeEnum : CommentTypeEnum.values()) {
            if(commentTypeEnum.getCode().equals(code)){
                return commentTypeEnum.getCode();
            }
        }
        return null;
    }

    public static String getType(Integer code) {
        for (CommentTypeEnum commentTypeEnum : CommentTypeEnum.values()) {
            if(commentTypeEnum.getCode().equals(code)){
                return commentTypeEnum.getMsg();
            }
        }
        return null;
    }


}
